home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / pas_0493.zip / MCGA.TXT < prev    next >
Text File  |  1993-04-22  |  4KB  |  73 lines

  1. ─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
  2. Msg  : 396 of 474                                                               
  3. From : James Cook                          1:387/307.0          16 Apr 93  22:59 
  4. To   : All                                                                       
  5. Subj : MCGA #1 Tutorial                                                       
  6. ────────────────────────────────────────────────────────────────────────────────
  7.                            MCGA Graphics Tutorial
  8.                                  Lesson #1
  9.                                 by Jim Cook
  10.  
  11. I'm not sure how this online tutorial will be received, but with your
  12. comments and feedback I plan on creating a full-blown animation package. This
  13. graphics library will be available to the public domain and will contain the
  14. following abilities:
  15.  
  16.                 Setting/Reading Pixels
  17.                 Drawing lines
  18.                 Saving/Restoring areas of the screen
  19.                 Displaying PCX/LBM files to the screen
  20.                 Spriting (Display picture with transparent areas)
  21.                 Palette control (Smooth fades to black)
  22.                 Page flipping
  23.  
  24. Before we're done, you will have the tools to produce programs with rich,
  25. even photo-realistic (for the resolution) images on your PC.  The necessary
  26. hardware is a VGA card and monitor that's it.  I'll be using Turbo Pascal
  27. version 6.0.  Please holler if that will be a problem.  I'm using it to
  28. create inline assembly.  My alternatives are inline code (yuk) or linking in
  29. external assembly.  For speed (and actually ease) the latter is better.  If I
  30. receive three complaints against 6.0, I'll use external assembly.
  31.  
  32.                                 What is MCGA?
  33.  
  34. Multi-Color Graphics Array is the video card that IBM built into it's Model
  35. 25 and 30 PS/2's.  It subsequently became a subset of the standard VGA
  36. adapter card.  It has the distiction of being the first card (excluding
  37. Targa and other expensive cards) to display 256 colors at once on the
  38. computer screen.  To us that meant cool games and neat pictures.  The MCGA
  39. addapter has added two new video modes to the PC world:
  40.  
  41.                 Mode $11        640x480x2 colors
  42.                 Mode $13        320x200x256 colors
  43.  
  44. Obviously, we will deal with mode $13.  If we wanted to deal with two
  45. colors, we'd be programming a CGA.  So much for the history lesson...let's
  46. dive in.
  47.  
  48. I've created a unit, MCGALib, that will contain all of our MCGA routines.
  49. The first two procedures we will concern ourselves with are setting the
  50. graphics mode and setting a pixel.  The MCGALib is followed by a test
  51. program that uses the two procedures.
  52.  
  53. e where these listings could get unbearably long in time.  I'll
  54. explore a few ways I can get this information to ya'll without taking up too
  55. much space. I would like you to make sure this routine works, just in case
  56. you ou graphis card. You may notce two SetPxel
  57. procedures in the MCGALib, one is commented out.  Remove the comments,
  58. comment up the uncommented SetPixel and run the test program aain.  Notice
  59. the speed degradation.  Linking in raw assembly will even improve upon the
  60. speed of the inline assembly.
  61. Please take the time to study each procedure and ASK ANY QUESTIONS that you
  62. may have, even if it doesn't relate to the graphics routines.  I'm certain I
  63. do not want to get pulled off track by any discussions about STYLE or critique 
  64. for others to learn rom.
  65.  
  66.                               Coming next time
  67.  
  68. I think a discussion of video memory is paramount.  Possibly vertical and
  69. horizontal lines, if space permits.
  70.  
  71. Happy grafx
  72. jim
  73.